<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="fixed-table-toolbar">
					<div class="columns pull-right" role="group">
						<button class="btn btn-success" onclick="queryBtnClick()"><i class="fa fa-search" aria-hidden="true"></i>查询</button>
						<button class="btn btn-danger" onclick="exportWithDrawals()" shiro:hasPermission="finance:withdrawals:export">
							<i class="fa fa-mail-reply-all" aria-hidden="true"></i>导出</button>
					</div>

					<input type="hidden" name="centreId" th:value="${centreId}" th:if="${flag} == '1'">
					<div class="columns pull-right col-md-1 nopadding" th:if="${flag} == '0'">
						<select data-placeholder="商户" class="form-control chosen-select" name="centreId"  id="centreId"  tabindex="2">
							<option value="">选择商户</option>
							<option th:each="item: ${centreList}" th:text="${item.name}" th:value="${item.centreId}"></option>
						</select>
					</div>
					<div class="pull-right search col-md-1 nopadding">
							<select data-placeholder="记录类型" class="form-control chosen-select" name="role" tabindex="2" 
							onchange="change()">
							 <option value="0">会员申请</option>
							  <option value="3">门店申请</option>
							 <option value="1">供应商申请</option>
						</select>
					</div>
				
				
					<div class="pull-right search col-md-2 nopadding" th:if="${flag} == '0'">
							<select data-placeholder="供应商区分" class="form-control chosen-select" name="suppliertype" 
							id="suppliertype" tabindex="2" >
							 <option value="">-请选择供应商区分 -</option>
							  <option value="0">平台供应商</option>
							 <option value="1" >站点供应商</option>
						</select>
					</div>
				
					<div class="pull-right search col-md-1 nopadding">
						<input id="queryItem" type="text" class="form-control" placeholder="会员ID/昵称/手机">
					</div>

					<div class="columns pull-right col-md-1 nopadding">
						<input type="text" class=" form-control"
							   id="end" name="end" placeholder="请选择结束日期"
							   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
							   style="background-color: #fff;" readonly="readonly"/>
					</div>

					<div class="columns pull-right">
						<label style="font-weight: 700;float: left;padding: 3px 10px;line-height: 2;font-size: 15px">
							<i class="fa fa-exchange"></i>
						</label>
					</div>

					<div class="columns pull-right col-md-1 nopadding">
						<input type="text" class=" form-control"
							   id="start" name="start" placeholder="请选择开始日期"
							   onclick="laydate({istime: false, format: 'YYYY-MM-DD'})"
							   style="background-color: #fff;" readonly="readonly"/>
					</div>
				</div>
			</div>
			
			<div class="col-lg-12 col-md-12 col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<div class="gg-nav">
							<ul class="nav nav-tabs">
								<li class="active" value="1">
									<a href="#unchecked" onclick="reLoadUnchecked()" data-toggle="tab">待审核</a>
								</li>
								<li value="2">
									<a href="#waitPay" onclick="loadWaitPay()" data-toggle="tab">待打款</a>
								</li>
								<li value="3">
									<a href="#wxPay" onclick="loadWxPay()" data-toggle="tab">微信已打款</a>
								</li>
								<li value="4">
									<a href="#offlinePay" onclick="loadOfflinePay()" data-toggle="tab">线下已打款</a>
								</li>
								<li value="5">
									<a href="#bankPay" onclick="loadbankPay()" data-toggle="tab">银行卡打款</a>
								</li>
								<li value="6">
									<a href="#disabled" onclick="loadRefused()" data-toggle="tab">无效记录</a>
								</li>
								<li value="7">
									<a href="#bankProcess" onclick="loadbankProcess()" data-toggle="tab">打款中</a>
								</li>
							</ul>
						</div>
					</div>
					<div class="tab-content">
						<!--unchecked 未审核-->
						<div class="ibox-content tab-pane fade in active"  id="unchecked">
							<div class="fixed-table-toolbar">
								<div class="columns pull-left">
									<button type="button" class="btn  btn-danger" shiro:haspermission="finance:withdrawals:batchPass" onclick="batchCheck()">
										<i class="fa fa-check" aria-hidden="true"></i>批量审核
									</button>
								</div>
							</div>
							<table id="unCheckedTable" data-mobile-responsive="true"></table>
						</div>

						<!--waitPay 待打款-->
						<div class="ibox-content tab-pane fade in"  id="waitPay">
							<div class="fixed-table-toolbar">
								<div class="columns pull-left">
									<button type="button" class="btn btn-danger" shiro:haspermission="finance:withdrawals:batchWxPay" onclick="batchWxPay()">
										<i class="fa fa-list" aria-hidden="true"></i>批量微信打款
									</button>
									<button id="plyhkdk" type="button" class="btn btn-danger" shiro:haspermission="finance:withdrawals:batchBankPay" onclick="batchBankPay()">
										<i class="fa fa-list" aria-hidden="true"></i>批量银行卡打款
									</button>
								
									<button type="button" class="btn btn-warning" shiro:haspermission="finance:withdrawals:batchOfflinePay" onclick="batchOfflinePay()">
										<i class="fa fa-reorder" aria-hidden="true"></i>批量线下打款
									</button>
								</div>
							</div>
							<table id="waitPayTable" data-mobile-responsive="true"></table>
						</div>

						<!--wxPay 微信已打款-->
						<div class="ibox-content tab-pane fade in"  id="wxPay">
							<table id="wxPayTable" data-mobile-responsive="true"></table>
						</div>

						<!--offlinePay 线下已打款-->
						<div class="ibox-content tab-pane fade in"  id="offlinePay">
							<table id="offlinePayTable" data-mobile-responsive="true"></table>
						</div>
						
						<!--offlinePay 银行卡已打款-->
						<div class="ibox-content tab-pane fade in"  id="bankPay">
							<table id="bankPayTable" data-mobile-responsive="true"></table>
						</div>

						<!--disabled 无效记录-->
						<div class="ibox-content tab-pane fade in"  id="disabled">
							<table id="disabledTable" data-mobile-responsive="true"></table>
						</div>
						
						<!--disabled 打款中-->
						<div class="ibox-content tab-pane fade in"  id="bankProcess">
							<div class="fixed-table-toolbar">
								<div class="columns pull-left">
									<button type="button" class="btn btn-warning" shiro:haspermission="finance:withdrawals:callback" onclick="callback()">
										<i class="fa fa-reorder" aria-hidden="true"></i>批量回调
									</button>
									
								</div>
							</div>
						
							<table id="bankProcessTable" data-mobile-responsive="true"></table>
						</div>
						
					</div>
				</div>
			</div>
			
		</div>
	</div>

	<div>
		<script type="text/javascript">
			var s_checked_pass_h = 'hidden';
			var s_refuse_h = 'hidden';
            var s_bank_h = 'hidden';
			var s_wx_pay_h = 'hidden';
			var s_offline_pay_h = 'hidden';
			var s_callback_h = 'hidden';
		</script>
	</div>

	<div shiro:hasPermission="finance:withdrawals:pass">
		<script type="text/javascript">
			s_checked_pass_h = '';
		</script>
	</div>
	<div shiro:hasPermission="finance:withdrawals:refuse">
		<script type="text/javascript">
			s_refuse_h = '';
		</script>
	</div>

	<div shiro:hasPermission="finance:withdrawals:wxPay">
		<script type="text/javascript">
			s_wx_pay_h = '';
		</script>
	</div>
	<div shiro:hasPermission="finance:withdrawals:offlinePay">
		<script type="text/javascript">
			s_offline_pay_h = '';
		</script>
	</div>
	<div shiro:hasPermission="finance:withdrawals:batchBankPay">
		<script type="text/javascript">
		   s_bank_h = '';
		</script>
	</div>
	<div shiro:hasPermission="finance:withdrawals:callback">
		<script type="text/javascript">
		 s_callback_h  = '';
		</script>
	</div>

	<div th:include="include :: footer"></div>
	<script type="text/javascript">
		function closeDow() {
			var index = parent.layer.getFrameIndex(window.name); // 获取窗口索引
			parent.layer.close(index);
		}
	</script>
	<script type="text/javascript" src="/js/appjs/finance/withdrawals/withdrawals.js"></script>
</body>
</html>
